1. Field of the Invention
This invention relates to a signal processing method, such as a method for extracting various data from an input signal or a method for compressing or recording data, and a sound source data forming apparatus. More particularly, it relates to a method for processing signals, such as pitch detection or filtering of input musical sound signals, data compression on a block-by-block basis and extraction of waveform repetition periods, by a so-called digital signal processor (DSP), and an apparatus for forming sound source data by these methods.
2. Description of the Prior Art
In general, a sound source used in an electronic musical instrument or a TV game unit may be roughly classified into an analog sound source composed of, for example, VCO, VCA and VCF, and a digital sound source, such as a programmable sound generator (PSG) or a waveform ROM read-out type sound source. As a kind of such digital sound source, there has recently become extensively known a sampler sound source which is the sound source data sampled and digitized from live sounds of musical instruments and stored in a memory.
Since a large capacity memory is generally required for storing sound source data, various techniques have been proposed for memory saving. Typical of these are a looping technique which takes advantage of the periodicity of the waveform of the musical sound, and bit compression, for example by non-linear quantization.
The above mentioned looping is also a technique for producing a sound for a longer time than the original duration of the sampled musical sound. In the waveform of, for example, a musical sound, a non-tone component, such as the noise of a key stroke in a piano or the breath noise of a wind musical instrument is contained in the waveform and hence a formant portion with inexplicit waveform periodicity is formed. After this formant portion, the waveform starts to be repeated at a basic period corresponding to the interval, that is, the pitch or sound height, of the musical sound. By repeatedly reproducing n periods of the repetitive waveform, n being an integer, a sound to be sustained for a long time may be produced with a lesser memory capacity.
The above described looping is beset with a problem of a noise peculiar to looping which is known as looping noise. This looping noise is produced at the time of switching the loop waveform and exhibits a spectral distribution of frequency characteristics. For this reason, it is conspicuous even if the noise level is lower than that of ordinary white noise. Several factors are thought to be responsible for such looping noise.
One of the factors is that the looping period is not fully coincident with the period of the waveform of the source of the musical signals. For example, when a source of 401 kHz is looped at a period of 400 Hz, the looped waveform has only frequency components equal to an integer multiple of the looping period. Thus the fundamental frequency of the source is forcibly shifted to 400 Hz with the distortion presenting itself as harmonics having the frequencies of 800 Hz, 1600 Hz, etc. It can be demonstrated that, when there is an offset of 1% between the source frequency and the looping frequency, a n'th order harmonic component of EQU C.sub.n =(sin (n-0.01))/(.pi.(n-0.01)) (a)
is produced during looping and heard as looping noise.
Another factor produced by non-integral order harmonics is k'th order harmonics, where k is a non-integral number, which are contained in the source. The source waveform, while apparently periodic, is strictly not a periodic function, but contains several non-integral order harmonics. During looping, these harmonics are forcibly shifted to the neighboring non-integral order harmonics. The distortion caused during looping is heard as the looping noise. In the case of looping harmonic overtones having the frequency component which is a times as high as the looping frequency, where a is not necessarily an integral number, the distortion factor of the distortion produced by looping is expressed as the function of a and given by ##EQU1## where m is an integer closest to a. The distortion factor becomes maximum for a=0.5, 1.5, 2.5, etc. and minimum for a=1.0, 2.0, 3.0 etc.
These two factors are thought to be mainly responsible for looping noise. In any case, looping noise is produced when the looping period is not an integral number of times of the source period.
As above, the frequency components of this looping noise has a spectral distribution and are not desirable to hear so that they should be removed to the maximum extent possible.
On the other hand, the musical sound data sampled and stored in a memory is the actual musical sound which has been directly digitized and recorded on a recording medium, so that the sound quality at the time of reproduction is determined by that at the time of sampling. For example, when the sound at the time of sampling contains a large quantity of noise components, the musical sound signal read out and reproduced from the recording medium also contains these noise components as such. When so-called vibrato is previously applied to the musical sound to be sampled, the sound is slightly frequency modulated. During looping, the sideband component produced by the frequency modulation also proves to be non-integral order harmonics so as to be reproduced as the noise.
The conventional practice in selecting the start point and the looping end point for looping has been simply to select two points of the same level, such as zero-crossing points, as the looping points.
However, such looping point selection is a difficult and time-consuming operation since a looping start and end points are repeatedly connected to each other on the trial and error basis after points having approximately equal values are selected as the looping start and end points.
It is also necessary to detect the period and the fundamental frequency or so-called pitch of the source which is the musical signal. The conventional practice for such detection is to pass the musical sound data through a low pass filter (LPF) to remove high frequency noise components from the waveform and to count the number of zero-crossing points of the waveform after passage through the LPF to find the basic frequency of the music sound data waveform to measure the pitch. However, with this method, it is necessary for the musical sound to be sustained for a prolonged time, since the pitch frequency or the frequency of a fundamental tone cannot be measured unless a large number of zero-crossing points is counted. Thus the above method cannot be applied to processing a sound of short duration.
As another method for measuring the pitch, consists of processing the musical sound data by fast Fourier transform (FFT) to detect and measure the peak of the musical sound data. However, if the frequency of the pitch or the fundamental tone is more than half the sampling frequency f.sub.s, it is not possible with this method to determine the peak frequency of the fundamental tone, resulting in poor accuracy. In addition, some musical sounds may have a fundamental tone component much lower than the harmonic overtone components, in which case it is similarly difficult to determine the peak of the fundamental tone frequency efficiently.
The above mentioned bit compression of the sound source data as another technique for saving memory is discussed hereinbelow. As a practical example, bit compression encoding may be envisioned in which a filter providing highest compression ratio on a block-by-block basis, each block consisting of a plurality of samples, is selected from a group of filters.
With such a filter-selecting type bit compression and encoding system, header or parameter data such as range or filter data are annexed to each block consisting of 16 samples of the wave height value data of the musical sound waveform. The filter data is used for selecting a filter which will give the highest compression ratio, or the compression ratio which is optimum for encoding, from the three mode filters, which are, straight PCM, a first order differential filter and a second order differential filter. Of these, the first and second order differential filters prove to be IIR filters at the time of decoding or reproduction, so that, when decoding or reproducing the leading sample of a block, one and two samples preceding the block are required as the initial values.
However, when the first or second order differential filters are selected in the leading block of the sound source data, there is no preceding sample, that is, the sample before the start of sound generation, so that one or two data must be stored in a storage medium such as a memory, as initial values. The provision of a storage medium represents an increase in hardware for the decoder and is not desirable for circuit integration and resulting cost reduction.